<?php
	
	$ajshijianwenjian = fopen("./dwajshijian.txt", "r") or die("Unable to read file!");
	$wjshijian = fread($ajshijianwenjian,filesize("./dwajshijian.txt"));
	fclose($ajshijianwenjian);
	file_put_contents("test.log","wjshijian: ".$wjshijian." LINE ".__LINE__."\n", FILE_APPEND);
	$accesstime=date("Y-m-d h:i:s");
	file_put_contents("test.log","accesstime: ".$accesstime." LINE ".__LINE__."\n", FILE_APPEND);
	if($wjshijian)
	{
		$chazhi = strtotime($wjshijian) - strtotime($accesstime)  ;
	#$accesstime=date("Y-m-d h:i:s");
		file_put_contents("test.log","chazhi ".$chazhi."  accesstime ".strtotime($accesstime)."  wjshijian ".strtotime($wjshijian)." LINE ".__LINE__."\n", FILE_APPEND);
		echo "chazhi ".$chazhi."  accesstime ".strtotime($accesstime)."  wjshijian ".strtotime($wjshijian);
    }

/*     $dwrenlianwenjianlujing = "./dwrlwj/dwrenliantongzhi0.txt";
	$renliantongzhiwenjian = fopen($dwrenlianwenjianlujing, "r") or die("Unable to read file!");
	$jsonduixiang = fread($renliantongzhiwenjian,filesize($dwrenlianwenjianlujing));
	file_put_contents("test.log", "filesize:".filesize($dwrenlianwenjianlujing)."  LINE:".__LINE__."\n", FILE_APPEND);
//	$jsonduixiang = fread($renliantongzhiwenjian,100);
	fclose($renliantongzhiwenjian);
//	file_put_contents("test.log", "jsonduixiang:".$jsonduixiang."  LINE:".__LINE__."\n", FILE_APPEND);
	$jsonchuan = json_decode($jsonduixiang,true);
	$rljilu = $jsonchuan["tkid"];
	$rlgonghao = $jsonchuan["gonghao"];
	file_put_contents("test.log", "chucuo rljilu:".$rljilu." rlgonghao:".$rlgonghao."  LINE:".__LINE__."\n", FILE_APPEND);
//	$params = "value"; #传递给python脚本的入口参数 
//	$path="cd D:\code\2018\face\dwrl && python3 dwwj.py "; //需要注意的是：末尾要加一个空格
//	passthru($path.$params);//等同于命令`python python.py 参数`，并接收打印出来的信息
//	$path="python3 D:\\code\\2018\\face\\dwrl\\dwwj.py ";
//	$path="d: && cd D:\\code\\2018\\face\\dwrl && python3 dwwj.py";
//	$path="D:\\code\\2018\\Python36\\python3 dwwj.py";
/*	$path="python3 dwwj.py";
	file_put_contents("test.log", $path."\n", FILE_APPEND);
//	passthru($path);
	exec ($path);
	file_put_contents("test.log", $path." LINE ".__LINE__."\n", FILE_APPEND);*/
?>	
